<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../jquery/jquery-3.5.1.min.js"></script>
  <style>
    .rd {
      color: red;

    }
    .yl {
      background-color: yellow;
    }
  </style>
</head>
<body>
  <!-- 我要写注释 -->
  <div class="box1" id="boxid"></div>
  <input type="text" >
  <input type="checkbox" name="" id="">
  <script>
    $('div').html("这是box1");
    console.log($('div').html());
    $('input:text').val("这是text的内容");
    console.log($('input:text').val());
    $('.box1').addClass('rd');
    $('.box1').removeClass('rd');
    $('.box1').toggleClass('rd');
    console.log($('div').addClass());
    $('div').attr("index", "5");
    console.log($('div').attr("index"));
    $("input").prop("checked", true);
    console.log($("input").prop("checked"));
    // $('div').click(function () {
    //   $('div').toggleClass('rd yl');
    // })
    $('div').on('click', function () {
      $('div').toggleClass('rd yl');
    })
  </script>

  <script>
    $('div').css("color", 'yellow');
    $('div').css({
      color: 'red',
      backgroundColor: 'orange',
      height: '+=20',
      width: 200
    });
    console.log($('div').css('width'));
    console.log($('div').offset()); //文档边缘
    
  </script>
</body>
</html>